package cn.itheima_02;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

//模拟斗地主发牌
public class DouDiZ {
	public static void main(String[] args) {
		//买牌;
		String[] s={"♠","♥","♣","♦"};
		String[] colo={"A","2","3","4","5","6","7","8","9","J","Q","K"};
		//将牌放到盒子
		//创建集合对象
		ArrayList<String> box=new ArrayList<String>();
		
		for (int i = 0; i < s.length; i++) {
			
			for (int j = 0; j < colo.length; j++) {
				box.add(s[i]+colo[j]);
				
			}
		}
		//加上大小王
		box.add("大王");
		box.add("小王");
		//洗牌;
		Collections.shuffle(box);
		//System.out.println(box);
		//发牌;
		//找三个牌友
		ArrayList<String> 韩雪=new ArrayList<String>();
		ArrayList<String> leikai=new ArrayList<String>();
		ArrayList<String> 韩小宁=new ArrayList<String>();
		
		for (int i = 0; i < box.size()-3; i++) {
			if(i%3==0){
				韩雪.add(box.get(i));
			}else if(i%3==1){
				leikai.add(box.get(i));
			}else{
				韩小宁.add(box.get(i));
			}
		}
		System.out.println("韩雪:"+韩雪);
		System.out.println("leikai:"+leikai);
		System.out.println("韩小宁:"+韩小宁);
		//底牌
		for (int i = box.size()-3; i < box.size(); i++) {
			System.out.println("底牌"+box.get(i));
		}
		
	}

}
